/*
 * @(#)IndustryServiceImp.java
 * Copyright (c) 2011 TravelSky Technology Ltd. All Right Reserved. 
 */
package com.meetingshow.meeting.service;

import java.util.ArrayList;
import java.util.List;    
    
import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.BaseServiceImp;
import com.meetingshow.common.base.service.model.QueryResults;
import com.meetingshow.meeting.dao.IndustryDAO;
import com.meetingshow.meeting.dao.model.IndustryPO;
import com.meetingshow.meeting.service.model.IndustryQueryParas;
import com.meetingshow.meeting.service.util.IndustryQueryParasBuilder;
import com.meetingshow.meeting.service.util.IndustryServiceParas;

public class IndustryServiceImp extends BaseServiceImp implements IIndustryService {

    private IndustryDAO industryDAO;
    
    public IndustryDAO getIndustryDAO() {
        return industryDAO;
    }

    public void setIndustryDAO(IndustryDAO industryDAO) {
        this.industryDAO = industryDAO;
    }
    
    @Override
    public IndustryPO getIndustryById (java.lang.Integer industryId) throws Exception {
        return getIndustryDAO().getIndustryById(industryId);
    }
    
    @Override
    public QueryResults<IndustryPO> queryIndustry(IndustryQueryParas industryQueryParas)
            throws Exception {
        QueryStruct queryStruct = new QueryStruct();
        List<String> tableList = new ArrayList<String>();
        List<String> returnObjectList = new ArrayList<String>();
        
        tableList.add(IndustryServiceParas.INDUSTRYPO);
        returnObjectList.add(IndustryServiceParas.INDUSTRYPO);
        
        queryStruct.setTableList(tableList);
        queryStruct.setReturnObjectList(returnObjectList);
        
        queryStruct = IndustryQueryParasBuilder.industryQueryBuilder(queryStruct, industryQueryParas);
        QueryResults<IndustryPO> queryResults = getIndustryDAO().queryIndustry(queryStruct);
        return queryResults;
    }

    @Override
    public void removeIndustry(IndustryPO industryPO) throws Exception {
        getIndustryDAO().removeIndustry(industryPO);
    }

    @Override
    public void saveIndustry(IndustryPO industryPO) throws Exception {
        getIndustryDAO().saveIndustry(industryPO);
    }

    @Override
    public void updateIndustry(IndustryPO industryPO) throws Exception {
        getIndustryDAO().updateIndustry(industryPO);
    }

}